<template>
  <el-tree-select :props="defaultProps" v-model="value" :data="courseType" check-strictly :render-after-expand="false" />
</template>

<script setup lang="ts">
const { proxy } = getCurrentInstance();
//counter
import useCounterStore from "@/store/counter";
import { onMounted } from "vue";
const counter = useCounterStore();
let props = defineProps(["modelValue"]);
const emit = defineEmits(["update:modelValue"]);

let courseType = ref([]);
const defaultProps = ref({
  value: "_id",
  label: "name",
});

onMounted(() => {
  getInfo();
});

const value = computed({
  get() {
    return props.modelValue;
  },
  set(value: String) {
    emit("update:modelValue", value);
  },
});

async function getInfo() {
  let ret = await proxy.$apis.webCurriculum({
    type: "query",
  });
  courseType.value = proxy.$utils.transformArray(ret, "_id", "parentId");
}
</script>



<style lang="scss" scoped>
.container {
}
</style>






